package SwingWork;

import JDBCUI.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Test16 extends JFrame {

    public Test16()  {

        // 可以发现按钮和文本框都已经有了变化，给窗口润色不少。
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        }catch(Exception e) {
            System.out.println(e);
        }



        //创建顶层容器

        JFrame jframe = new JFrame("教师奖惩管理系统");

        Dimension d = new Dimension(300,400);
        Point p = new Point (250,350);
        //设置大小
        jframe.setSize(d);

        jframe.setLocation(p);
        jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //窗口放大
        //jframe.setResizable(false);


        //创建按钮组件
        JButton button1 = new JButton("添加");
        JButton button2 = new JButton("修改");
        JButton button3 = new JButton("查询");
        JButton button4 = new JButton("删除");
        JButton button5 = new JButton("浏览");
        //流布局 左对齐，间距
        FlowLayout flow = new FlowLayout(FlowLayout.LEFT,50,50);
        //创建中间容器
        JPanel panel = new JPanel(flow);
        //将负责放置控件的面板设置成透明
        // panel.setOpaque(false);


        //设置大小
        panel.setSize(300,400);
        //设置背景颜色
        panel.setBackground(Color.LIGHT_GRAY);
        panel.add(button1);
        panel.add(button2);
        panel.add(button3);
        panel.add(button4);
        panel.add(button5);


        //将中间容器放在窗口中
        jframe.getContentPane().add(panel);




        button1.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){
                increase increase =new increase();
            }
        });
        button2.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                revise revise =new revise();
            }
        });
        button3.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                query query =new query();
            }
        });
        button4.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                Delete delete =new Delete();
            }
        });
        button5.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                browse browse =new browse();
            }
        });


        //显示窗口

        jframe.setVisible(true);


    }

    public static void main(String[] args) {


    }
}






